package groep3.ssc.model;

import java.util.ArrayList;

public class Skater
{
    public static enum Lane {
        INNER, OUTER
    };

    private final static int ROUND_LENGTH = 400;

    private String name;
    private ArrayList<Long> laps;
    private int totalDistance = 0;
    private Lane lane;
    private long totalTime = 0;

    // Target schedule komt later
    // Difference with target schedule

    public Skater()
    {
        laps = new ArrayList<Long>();
    }

    public long getTotalTime()
    {
        return totalTime;
    }

    public void setTotalTime(long totalTime)
    {
        this.totalTime = totalTime;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public ArrayList<Long> getLaps()
    {
        return laps;
    }

    public void setLaps(ArrayList<Long> laps)
    {
        this.laps = laps;
    }

    public void addLap(long l)
    {
        laps.add(l);
    }

    public int getRoundNumber()
    {
        return (int) Math.floor(totalDistance / ROUND_LENGTH) + 1;
    }

    public int getTotalDistance()
    {
        return totalDistance;
    }

    public void setTotalDistance(int totalDistance)
    {
        this.totalDistance = totalDistance;
    }

    public Lane getLane()
    {
        return lane;
    }

    public void setLane(Lane lane)
    {
        this.lane = lane;
    }

    public int getLastLapTime()
    {
        if (laps.size() <= 0)
            return 0;

        return this.laps.get(laps.size() - 1).intValue();
    }

}
